home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / packer / zoo / zoolist.c < prev    next >
C/C++ Source or Header  |  1995-03-09  |  17KB  |  591 lines

  1. #ifndef LINT
  2. /* derived from: zoolist.c 2.27 88/08/15 11:03:16 */
  3. static char sccsid[]="$Source: /usr/home/dhesi/zoo/RCS/zoolist.c,v $\n\
  4. $Id: zoolist.c,v 1.4 91/07/09 01:54:16 dhesi Exp $";
  5. #endif /* LINT */
  6.  
  7. /*
  8. If TRACE_LIST is defined, any list command may be followed
  9. by 'D' to show verbose information about each directory
  10. entry in the archive.    Do not define both TRACE_LIST and
  11. TRACE_IO else a symbol conflict will occur and in any case
  12. duplicate information will be dumped.
  13. */
  14.  
  15. /* #define TRACE_LIST */
  16.  
  17. /*
  18. Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
  19. (C) Copyright 1988 Rahul Dhesi -- All rights reserved
  20. */
  21. #include "options.h"
  22. #include "portable.h"
  23. #include "zoomem.h"  /* to get ZOOCOUNT */
  24.  
  25. /* Lists files in archive */
  26. #include "zoo.h"
  27. #include "errors.i"
  28. #include "zooio.h"
  29. #include "various.h"
  30. #include "zoofns.h"
  31. #include <stdio.h>
  32.  
  33. #ifdef TRACE_LIST
  34. void show_dir PARMS ((struct direntry *direntry));
  35. static int trace_list = 0;
  36. #endif /* TRACE_LIST */
  37.  
  38. static char tot_fmt[] = "%8lu %3u%% %8lu  %4d file";
  39. static char tot_line[] =
  40.     /* "------------  --------  ---  --------  --------- --------\n"; */
  41.     "--------  --- --------  --------- --------\n";
  42.  
  43. static char dbl_percent[] = "Archive %s:  %s";
  44.  
  45. extern int quiet;             /* assumed initialized to zero */
  46.  
  47. void show_comment PARMS((struct direntry *, ZOOFILE, int, char *));
  48. int ver_too_high PARMS((struct zoo_header *));
  49. int needed PARMS((char *, struct direntry *, struct zoo_header *));
  50. void printtz PARMS((int));
  51.  
  52. void zoolist (argv, option, argc)
  53. char **argv, *option;
  54. int argc;
  55. {
  56. char whichname[PATHSIZE];    /* which name to use */
  57. char *this_zoo;                /* currently matched archive name */
  58. register ZOOFILE zoo_file;
  59. char *flist[ZOOCOUNT];          /* list of ptrs to input archive names */
  60. int fptr;                        /* will point to within list of archive names */
  61.  
  62. struct direntry direntry;
  63. struct zoo_header zoo_header;
  64. int size_factor;
  65. unsigned long tot_org_siz = 0L, tot_siz_now = 0L;
  66. int    tot_sf;
  67. int file_count = 0;
  68. int del_count = 0;                        /* number of deleted entries */
  69. int bad_pack;                        /* 1 if packing method is unknown */
  70. static char *month_list="000JanFebMarAprMayJunJulAugSepOctNovDec";
  71. static char dashes[] = "------------\n";
  72. int year, month, day, hours, min, sec;
  73. int list_deleted = 0;            /* list deleted files too */
  74. int fast = 0;                        /* fast list */
  75. long fiz_ofs = 0;                 /* offset where to start */
  76. long dat_ofs = 0;                 /* ... data offset of file data */
  77. int verb_list = 0;                /* if verbose listing needed */
  78. int show_name = 0;                /* if archive name to be included in listing */
  79. int show_crc = 0;                 /* if crc should be listed */
  80. int zoocount = 1;                 /* number of archives to list */
  81. int biglist = 0;                    /* multiarchive listing */
  82. int one_col = 0;                    /* one column listing requested */
  83. int showdir = 0;                    /* show directory name in fast listing */
  84. int longest;                        /* length of longest archive name */
  85. int talking;                        /* opposite of quiet */
  86. int column = 0;                    /* for column printing */
  87. int first_ever = 1;                /* first time ever -- very special case */
  88. int neednl = 0;                    /* whether to print a newline */
  89. int need_acmt = 0;                /* show archive comment */
  90. int show_gen = 0;                 /* show generation count */
  91. int genson = 1;                    /* enable/disable generations */
  92. #ifdef FATTR
  93. int show_mode = 0;                /* show file protection */
  94. #endif
  95. int first_dir = 1;                /* if first direntry -- to adjust dat_ofs */
  96.  
  97. while (*option) {
  98.     switch (*option) {
  99.         case 'a': show_name++; break;
  100. #ifdef TRACE_LIST
  101.         case 'D': trace_list++; break;
  102. #endif /* TRACE_LIST */
  103.         case 'd': list_deleted++; break;
  104.         case 'f': fast++; break;
  105.         case 'g': show_gen++; break;
  106.         case '/': showdir++; break;
  107.         case 'A':
  108.         case 'v': need_acmt++; break;
  109.         case 'V': need_acmt++; /* fall through */
  110.         case 'c': verb_list++; break;
  111.         case 'C': show_crc++; break;
  112.         case 'l': break;
  113.         case 'L': biglist++; zoocount = argc; break;
  114. #ifdef FATTR
  115.         case 'm': show_mode++; break;
  116. #endif
  117.         case '1': one_col++; break;
  118.         case '+': genson = 1; break;
  119.         case '-': genson = 0; break;
  120.         /* following code same as in zooext.c */
  121.         case '@':   /* if @m,n specified, fiz_ofs = m, dat_ofs = n */
  122.             {
  123.                 char *comma_pos;
  124.                 ++option;
  125.                 comma_pos = strchr(option, ',');
  126.                 if (comma_pos != NULL) {
  127.                     dat_ofs = calc_ofs (comma_pos + 1);
  128.                     *comma_pos = '\0';
  129.                 }
  130.                 fiz_ofs = calc_ofs(option);
  131.                 goto no_more;
  132.             }
  133.         case 'q': quiet++; break;
  134.         default:
  135.             prterror ('w', option_ignored, *option);
  136.     }
  137.     option++;
  138. }
  139.  
  140. no_more:  /* come from exit from while loop above */
  141.  
  142. if (fast && show_name) {      /* don't allow 'a' with 'f' */
  143.     show_name = 0;
  144.     prterror ('w', option_ignored, 'a');
  145. }
  146.  
  147. talking = !quiet;                 /* for convenience */
  148.  
  149. #ifdef WILDCARD
  150.     /* For each archive name supplied, if it is not a char range and
  151.         does not contain a dot, append "*.zoo". */
  152.     {
  153.         int i;
  154.         for (i = 0; i < argc;  i++) {
  155.             if (strchr (nameptr (argv[i]), EXT_CH) == NULL &&
  156.                                     !match_half (nameptr (argv[0]), "?-?"))
  157.                 argv[i] = newcat (argv[i], "*.zoo");
  158.         }
  159.     }
  160. #endif
  161.  
  162. makelist (zoocount, argv, flist,        ZOOCOUNT-2,   (char *) NULL,".","..", &longest);
  163. /*          ^argc      ^argv ^list_pointer ^max_no_files   ^exclude */
  164.  
  165. for (fptr = 0;  (this_zoo = flist[fptr]) != NULL; fptr++) {
  166.     int ercount;                        /* count of errors */
  167.     int entrycount;                    /* count of directory entries */
  168.     int expl_deleted;                 /* explain what D means */
  169.     int expl_comment;                 /* explain what comment means */
  170.     int expl_ver;                        /* Explain what V means */
  171.     int expl_star;                     /* Explain what * means */
  172.     int first_time;                    /* first time through loop for an archive */
  173.  
  174.     ercount = entrycount = del_count =
  175.         expl_deleted = expl_comment = expl_ver = expl_star = 0;
  176.  
  177.     if (talking)
  178.         column = 0;                     /* if quiet, names will run together */
  179.  
  180.     first_time = 1;
  181.  
  182. #ifndef WILDCARD
  183.     /* Add default extension if none supplied */
  184.     if (strchr (nameptr (this_zoo), EXT_CH) == NULL)
  185.         this_zoo = newcat (this_zoo, EXT_DFLT);
  186. #endif
  187.  
  188.     zoo_file = zooopen (this_zoo, Z_READ);
  189.  
  190.     if (zoo_file == NOFILE) {
  191.         prterror ('e', could_not_open, this_zoo);
  192.         continue;
  193.     } else if (!show_name && talking)
  194.         printf ("\nArchive %s:\n", this_zoo);
  195.  
  196. if (fiz_ofs != 0L) {                /* if offset specified, start there */
  197.     prterror ('m', start_ofs, fiz_ofs, dat_ofs);
  198.     zooseek (zoo_file, fiz_ofs, 0);
  199. } else {
  200.     if (frd_zooh (&zoo_header, zoo_file) == -1 ||
  201.                                                             zoo_header.zoo_tag != ZOO_TAG) {
  202.         prterror ('e', dbl_percent, this_zoo, invalid_header);
  203.         goto loop_end;
  204.     }
  205. #if 0
  206.     if (talking && (!show_name || verb_list || need_acmt))
  207. #else
  208.     if (need_acmt && talking)
  209. #endif
  210.     {
  211.         void show_acmt PARMS ((struct zoo_header *, ZOOFILE, int));
  212.         show_acmt (&zoo_header, zoo_file, 0);     /* show archive comment */
  213.     }
  214.  
  215.     /* Seek to the beginning of the first directory entry */
  216.     if (zooseek (zoo_file, zoo_header.zoo_start, 0) != 0) {
  217.         ercount++;
  218.         prterror ('e', dbl_percent, this_zoo, bad_directory);
  219.         goto loop_end;
  220.     }
  221.     if (!show_name && ver_too_high (&zoo_header)) {
  222.         ercount++;
  223.         if (ercount < 2)
  224.             prterror ('M', wrong_version,
  225.                                         zoo_header.major_ver, zoo_header.minor_ver);
  226.     }
  227. } /* end if (fiz_ofs !- 0L) */
  228.  
  229.     /* Now we print information about each file in the archive */
  230.  
  231.     if (!show_name) { /* initialize for each file only if not disk catalog */
  232.         tot_org_siz = 0L;
  233.         tot_siz_now = 0L;
  234.         file_count = 0;
  235.         del_count = 0;
  236.     }
  237.  
  238.     while (1) {
  239.         if (readdir (&direntry, zoo_file, 0) == -1) {
  240.             prterror ('F', dbl_percent, this_zoo, bad_directory);
  241.             goto givesummary;
  242.         }
  243.         if (direntry.zoo_tag != ZOO_TAG) {
  244.             long currpos, zoolength;
  245.             prterror ('F', dbl_percent, this_zoo, invalid_header);
  246.             if ((currpos = zootell (zoo_file)) != -1L)
  247.                 if (zooseek (zoo_file, 0L, 2) == 0)
  248.                     if ((zoolength = zootell (zoo_file)) != -1L)
  249.                         printf (cant_process, zoolength - currpos);
  250.             goto givesummary;
  251.         }
  252.  
  253.         if (direntry.next == 0L)      /* EXIT on end of chain */
  254.             break;
  255.         else
  256.             entrycount++;                    /* Number of directory entries */
  257.         /* first direntry read, change dat_ofs from abs. pos. to rel. offset */
  258.         if (first_dir && dat_ofs != 0) {
  259.             dat_ofs -= direntry.offset;
  260.             first_dir = 0;
  261.         }
  262.         direntry.next += dat_ofs;                /* allow for user-specified offset */
  263.         if (direntry.comment != 0L)
  264.             direntry.comment += dat_ofs;        /* so show_comment finds it */
  265.  
  266.         if (direntry.deleted)
  267.             ++del_count;
  268.  
  269. #ifdef TRACE_LIST
  270.         if (trace_list)
  271.             show_dir (&direntry);
  272. #endif /* TRACE_LIST */
  273.  
  274.         /* Into `whichname' put the filename to display. Use long filename if
  275.         it exists, else use short filename.  */
  276.             strcpy (whichname, fullpath (&direntry));
  277.             if (zoo_header.vdata & VFL_ON)
  278.                 add_version (whichname, &direntry); /* add version suffix */
  279. #ifdef DEBUG
  280.         printf("matching against [%s] and [%s]\n",
  281.                     nameptr(whichname), whichname);
  282. #endif
  283.  
  284.         if ( ( (list_deleted && direntry.deleted) ||
  285.                     (list_deleted < 2 && !direntry.deleted)
  286.               )
  287.                   && (biglist || needed(whichname, &direntry, &zoo_header))) {
  288.             /* if generations forced off, then strip added version field */
  289.             if (!genson) { /* HORRENDOUSLY INEFFICIENT AND REPETITIOUS */
  290.                 char *ver_pos;
  291.                 ver_pos = findlast (whichname, VER_DISPLAY);
  292.                 if (ver_pos != NULL)
  293.                     *ver_pos = '\0';
  294.             }
  295.  
  296.             file_count++;
  297.  
  298.             if (direntry.packing_method > MAX_PACK) {
  299.                 bad_pack = 1;
  300.                 expl_ver = 1;
  301.             }    else
  302.                 bad_pack = 0;
  303.  
  304.             size_factor = cfactor (direntry.org_size, direntry.size_now);
  305.  
  306.             year    =    ((unsigned int) direntry.date >> 9) & 0x7f;
  307.             month =    ((unsigned int) direntry.date >> 5) & 0x0f;
  308.             day    =    direntry.date            & 0x1f;
  309.  
  310.             hours =    ((unsigned int) direntry.time >> 11)& 0x1f;
  311.             min    =    ((unsigned int) direntry.time >> 5) & 0x3f;
  312.             sec    =    ((unsigned int) direntry.time & 0x1f) * 2;
  313.  
  314.             /* Alignment in columns is a horrendously complex undertaking. */
  315.  
  316.             if (fast) {
  317.                 int space_left;
  318.                 int namelen;
  319.                 int next_col;
  320. #if 0
  321.                 if ( (quiet && !first_ever || !first_time) && one_col)
  322.                     fputchar ('\n');
  323.                 first_ever = 0;
  324. #endif
  325.                 /* If we are showing directories, whichname already contains the
  326.                 full pathname string.  Else we only use the filename as follows:
  327.                 long filename if possible, else short filename */
  328.                 if (!showdir) {
  329.                     strcpy (whichname,
  330.                         (direntry.namlen != 0) ? direntry.lfname : direntry.fname);
  331.                     if (genson && zoo_header.vdata & VFL_ON)
  332.                         add_version (whichname, &direntry); /* add version suffix */
  333.                 }
  334.                 namelen = strlen (whichname);
  335.  
  336. #define MARGIN         78
  337. #define COL_WIDTH     16
  338. #if 1
  339.                 /* if not enough space left, move to next line */
  340.                 if (!one_col && column != 0) {
  341.                     space_left = MARGIN - column;
  342.                     if (namelen > space_left) {
  343.                         neednl = 1;
  344.                         column = 0;
  345.                     }
  346.                 }
  347. #endif
  348.                 if ( (quiet && !first_ever || !first_time) && (neednl || one_col))
  349.                     printf ("\n");
  350.                 first_ever = 0;
  351.                 neednl = 0;
  352.  
  353.                 printf("%s", whichname);
  354.                 fflush (stdout);
  355.                 /* move to next column stop */
  356.                 column += namelen;
  357.                 next_col = ((column + (COL_WIDTH - 1)) / COL_WIDTH) * COL_WIDTH;
  358.                 if (next_col - column < 2)    /* need at least 2 spaces */
  359.                     next_col += COL_WIDTH;
  360.                 if (next_col > MARGIN) {
  361.                     neednl = 1;
  362.                     column = 0;
  363.                 } else {
  364.                     if (!one_col)
  365.                         printf ("%*s", (next_col - column), " ");
  366.                     column = next_col;
  367.                 }
  368.  
  369.             } else {
  370.                 if (talking && first_time && !show_name) {/*print archive header */
  371.                     printf ("Length    CF  Size Now  Date      Time\n");
  372.                     printf (tot_line);
  373.                 }
  374.                 printf ("%8lu %3u%% %8lu  %2d %-.3s %02d %02d:%02d:%02d",
  375.                             direntry.org_size,
  376.                             size_factor, direntry.size_now,
  377.                             day, &month_list[month*3],
  378.                             (day && month) ?  (year+80) % 100 : 0,
  379.                             hours, min, sec);
  380.                     tot_org_siz += direntry.org_size;
  381.                     tot_siz_now += direntry.size_now;
  382. #ifdef GETTZ
  383.                 printtz ((int) direntry.tz);  /* show timezone */
  384. #else
  385.                 printf (" ");
  386. #endif
  387.  
  388.                 if (show_crc)
  389.                     printf ("%04x ", direntry.file_crc);
  390.                 if (show_gen) {
  391.                     if (direntry.vflag & VFL_ON)
  392.                         printf ("%2dg ", direntry.vflag & VFL_GEN);
  393.                     else
  394.                         printf ("--g ");
  395.                 }
  396.  
  397.                 if (direntry.cmt_size) {
  398.                     expl_comment++;
  399.                     printf ("C");
  400.                 } else
  401.                     printf (" ");
  402.  
  403.                 if (direntry.deleted) {
  404.                     expl_deleted++;
  405.                     printf ("D");
  406.                 }    else
  407.                     printf (" ");
  408.                 if (list_deleted)
  409.                     printf (" ");
  410.                 if (show_name)
  411.                     printf ("%-*s ", longest, this_zoo);
  412.  
  413. #ifdef FATTR
  414.                 if (show_mode) {
  415.                     if (direntry.fattr == 0)
  416.                         printf ("--- ");
  417.                     else if ((direntry.fattr >> 22) == 1)
  418.                         printf ("%03o ", direntry.fattr & 0x1ff);
  419.                     else
  420.                         printf ("??? ");
  421.                 }
  422. #endif /* FATTR */
  423.  
  424.                 /* new code to get around a common compiler bug */
  425.                 printf ("%s", whichname);
  426.                 if (direntry.dir_crc != 0) {
  427.                     expl_star++;
  428.                     printf ("*");
  429.                 }
  430.  
  431.                 if (bad_pack)
  432.                     printf (" (V%d.%d)", direntry.major_ver, direntry.minor_ver);
  433.                 printf ("\n");
  434.             }
  435.             first_time = 0;
  436.  
  437.             /* if verbose listing requested show any comment.    f overrrides v */
  438.             if (verb_list && !fast)
  439.                 show_comment (&direntry, zoo_file, 0, (char *) NULL);
  440.         } /* end if (lots of conditions) */
  441.  
  442.         /* ..seek to next dir entry */
  443.         zooseek (zoo_file, direntry.next, 0);
  444.     } /* end while */
  445.  
  446.     givesummary:
  447.  
  448.     if (fast && talking) {
  449.         if (file_count) {
  450.             if (del_count || (show_gen && zoo_header.type > 0))
  451.                 printf ("\n-----\n");
  452.             else
  453.                 fputchar ('\n');
  454.         }
  455.         if (del_count)
  456.             printf ("%d deleted.\n", del_count);
  457.         if (show_gen && zoo_header.type > 0) {
  458.             printf ("Generation limit %u",
  459.                         zoo_header.vdata & VFL_GEN);
  460.             if ((zoo_header.vdata & VFL_ON) == 0)
  461.                 printf (" (off).\n");
  462.             else
  463.                 printf (".\n");
  464.         }
  465.     } /* end if (fast && talking) */
  466.  
  467.     if (talking && !show_name) {
  468.         if (!fast && file_count) {
  469.             tot_sf = cfactor (tot_org_siz, tot_siz_now);
  470.             printf (tot_line);
  471.  
  472.             printf (tot_fmt, tot_org_siz, tot_sf, tot_siz_now, file_count);
  473.             if (file_count > 1)
  474.                 printf ("s\n");
  475.             else
  476.                 printf ("\n");
  477.  
  478.             if (del_count || expl_ver || expl_deleted || expl_comment ||
  479.                     expl_star || (show_gen && (zoo_header.type > 0)))
  480.                 printf (dashes);
  481.         }
  482.  
  483.         if (!fast) {
  484.             if (del_count) {
  485.                 if (expl_deleted)
  486.                     printf ("D: deleted file.\n");
  487.                 else {
  488.                     if (del_count == 1)
  489.                         printf ("There is 1 deleted file.\n");
  490.                     else
  491.                         printf ("There are %d deleted files.\n", del_count);
  492.                 }
  493.             }
  494.         }
  495.         if (expl_comment && !fast && !verb_list)
  496.             printf ("C: file has attached comment.\n");
  497.         if (expl_ver && !fast)
  498.             printf ("V: minimum version of Zoo needed to extract this file.\n");
  499.         if (expl_star && !fast)
  500.             printf ("*: directory entry may be corrupted.\n");
  501.         if (!file_count)
  502.             printf ("Zoo:  %s", no_match);
  503.  
  504.         if (!entrycount && !fiz_ofs)
  505.             printf ("(The archive is empty.)\n");
  506.         if (show_gen && (zoo_header.type > 0) && !fast) {
  507.             printf ("Archive generation limit is %u",
  508.                         zoo_header.vdata & VFL_GEN);
  509.             if ((zoo_header.vdata & VFL_ON) == 0)
  510.                 printf (" (generations off).\n");
  511.             else
  512.                 printf (".\n");
  513.         }
  514.     } /* end if (talking && !show_name) */
  515. loop_end:                /* jump here on badly structured archive */
  516.     zooclose (zoo_file);
  517. } /* end for */
  518.  
  519. if (talking && show_name) {
  520.     if (file_count) {
  521.         tot_sf = cfactor (tot_org_siz, tot_siz_now);
  522.         printf (tot_line);
  523.         printf (tot_fmt, tot_org_siz, tot_sf, tot_siz_now, file_count);
  524.         if (file_count > 1)
  525.             printf ("s\n");
  526.         else
  527.             printf ("\n");
  528.     }
  529. } else if (fast && quiet)
  530.     fputchar ('\n');
  531.  
  532.  
  533. if (!file_count)
  534.     zooexit (1);            /* Consider it an error if there were no files */
  535. } /* zoolist() */
  536.  
  537. #ifdef GETTZ
  538. void printtz (file_tz)
  539. int file_tz;
  540. {
  541.     long gettz();
  542.     int diff_tz;                /* timezone difference */
  543.     if (file_tz == NO_TZ)   /* if no timezone stored ..*/
  544.         printf ("   ");         /* .. just pad with blanks */
  545.     else {
  546.         diff_tz = (file_tz / 4) - (int) (gettz() / 3600);
  547.         if (diff_tz == 0)
  548.             printf ("   ");               /* print nothing if same */
  549.         else if (diff_tz > 0)         /* else print signed difference */
  550.             printf ("+%1d ", diff_tz);
  551.         else
  552.             printf ("-%1d ", -diff_tz);
  553.     }
  554. }
  555. #endif
  556.  
  557. /*
  558. FOLLOWING CODE IS FOR DEBUGGING ONLY.    IT IS COMPILED IN ONLY
  559. IF THE SYMBOL TRACE_LIST IS DEFINED
  560. */
  561.  
  562. #ifdef TRACE_LIST
  563. /* code copied from portable.c near end */
  564. /* dump contents of directory entry */
  565. void show_dir (direntry)
  566. struct direntry *direntry;
  567. {
  568.     printf ("Directory entry for file [%s][%s]:\n",
  569.                 direntry->fname, direntry->lfname);
  570.     printf ("tag = [%8lx] type = [%d] PM = [%d] Next = [%8lx] Offset = [%8lx]\n",
  571.                 direntry->zoo_tag, (int) direntry->type,
  572.                 (int) direntry->packing_method, direntry->next,
  573.                 direntry->offset);
  574.     printf ("Orig size = [%ld] Size now = [%ld] dmaj_v.dmin_v = [%d.%d]\n",
  575.             direntry->org_size, direntry->size_now,
  576.             (int) direntry->major_ver, (int) direntry->minor_ver);
  577.     printf ("Struc = [%d] DEL = [%d] comment_offset = [%8lx] cmt_size = [%d]\n",
  578.             (int) direntry->struc, (int) direntry->deleted, direntry->comment,
  579.             direntry->cmt_size);
  580.     printf ("var_dir_len = [%d] TZ = [%d] dir_crc = [%4x]\n",
  581.                 direntry->var_dir_len, (int) direntry->tz, direntry->dir_crc);
  582.     printf ("system_id = [%d]  dirlen = [%d]  namlen = [%d] fattr=[%24lx]\n",
  583.         direntry->system_id, direntry->dirlen, direntry->namlen, direntry->fattr);
  584.     printf ("vflag = [%4x] version_no = [%4x]\n",
  585.                 direntry->vflag, direntry->version_no);
  586.     if (direntry->dirlen > 0)
  587.         printf ("dirname = [%s]\n", direntry->dirname);
  588.     printf ("---------\n");
  589. }
  590. #endif    /* TRACE_IO */
  591.